<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<%
	String path =request.getContextPath();
%>
<head>
    <meta http-equiv="x-ua-compatible" content="ie=7" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <script language="javascript" type="text/javascript">
     	function goback(){
     		var url = "<%=path%>/contract/goBack2ConfirmList";
			location.href = url;
     	}
     	
     	//合同接受
    	function acceptContract(){
		    headForm.action="<%=path%>/contract/acceptContracts";
			headForm.submit();
		}

		//合同拒绝
		function rejectContract() {
			var rejectReason=prompt("请输入拒绝原因：","");
       		if(trim(rejectReason)==null || trim(rejectReason)==""){
				alert("拒绝，必须输入拒绝原因。");
				return ;
           	}else{
  				document.getElementById("rejectReason").value=rejectReason;
	        	headForm.action="<%=path%>/contract/rejectContracts";
	        	headForm.submit();
   			}
		}
     </script>
    
</head>
<body class="fullbody">
        <div class="context">
        	<div class="position">
            	<div class="tposi">当前位置： 
                    	<a href="javascript:changeMenu(1,'<%=path%>/infopub/pubmain?menuid=1');"class="linkstyle">首页</a>&nbsp;&gt;&gt;&nbsp;
                       	<a href="javascript:changeMenu(3,'');" class="linkstyle">我的订单\合同</a>&nbsp;&gt;&gt;&nbsp;
                        <span class="curposition">合同确认</span>
                </div>
                <div class="help">
					<a href="javascript:void(null);" onclick="doHelp('<%=request.getContextPath()%>/help/html/HTQR.html');" class="linkstyle">帮助</a>
				</div>
            </div>
                <div class="subpage_title">
                    <div class="title_index">
                        <img src="<%=path%>/images/common/dot03.gif" alt="" border="0" />&nbsp;合同确认</div>
                </div>
                <div class="margin20"></div>
                <div class="subpage_bidlist">
                    <div>
                         <div  >
		                    <div class="title_index">
							    <div class="subpage_search" >
							      <form name="headForm"  method="post">
									<input type="hidden" value="" name="rejectReason" id="rejectReason" />
			                        <table border="0" cellpadding="0" cellspacing="0" class="searchtable">
			                            <tr>
			                                <td valign="middle" class="w_1">合同编号：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="billNo" name="billNo" type="text" value="${ctForm.billNo}" readonly="readonly" class="searchtext" />
			                                </td>
			                                <td valign="middle" class="w_1">合同名称：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="ctName" name="ctName" type="text" value="${ctForm.ctName}" readonly="readonly" class="searchtext" />
			                                </td>
			                            </tr>
			                            <tr>
			                            	<td valign="middle" class="w_1">版本号：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="versionNo" name="versionNo" type="text" value="${ctForm.versionNo}" readonly="readonly" class="searchtext" />
			                                </td>
			                                <td valign="middle" class="w_1">合同签定日期：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="ctSignDate" name="ctSignDate" type="text" value="${ctForm.ctSignDate}" readonly="readonly" class="searchtext"/>
			                                </td>
			                            </tr>
			                            <tr>
			                                <td valign="middle" class="w_1">计划生效日期：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="ctValiddate" name="ctValiddate" type="text" value="${ctForm.ctValiddate}" readonly="readonly" class="searchtext" />
			                                </td>
			                                <td valign="middle" class="w_1">计划失效日期：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="ctInvalidate" name="ctInvalidate" type="text" value="${ctForm.ctInvalidate}" readonly="readonly" class="searchtext" />
			                                </td>
			                            </tr>
			                            <tr>
			                           		<td valign="middle" class="w_1">收付款协议名称：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="protocalName" name="protocalName" type="text" value="${ctForm.protocalName}" readonly="readonly" class="searchtext" />
			                                </td>
			                                <td valign="middle" class="w_1">采购公司：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="purCorpName" name="purCorpName" type="text" value="${ctForm.purCorpName}" readonly="readonly" class="searchtext" />
			                                </td>
			                            </tr>
			                            <tr>
			                                <td valign="middle" class="w_1">采购部门：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="purDeptName" name="purDeptName" type="text" value="${ctForm.purDeptName}" readonly="readonly" class="searchtext" />
			                                </td>
			                                <td valign="middle" class="w_1">采购员：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="purPsnName" name="purPsnName" type="text" value="${ctForm.purPsnName}" readonly="readonly" class="searchtext" />
			                                </td>
			                            </tr>
			                            <tr>
			                                <td valign="middle" class="w_1">币种：</td>
			                                <td valign="middle" class="w_2">
			                                    <input id="curencyName" name="curencyName" type="text" value="${ctForm.curencyName}" readonly="readonly" class="searchtext" />
			                                </td>
			                            </tr>
			                            <tr>
			                            	<td colspan="4">
			                            	<input type="hidden" checked id="${ctForm.pkContract}" name="checkBoxComp"  value="${ctForm.pkContract}_${ctForm.ts}_${ctForm.confirmStatus}"/> 
											<input type="hidden" id="status_${ctForm.pkContract}" name="confirmStatus" value="${ctForm.confirmStatus}"/> 
											<input type="hidden" id="contractPageType" name="contractPageType" value="1"/> 
			                            	&nbsp;</td>
			                            </tr>
			                        </table>
			                       </form>
                    			</div>
			                    <div class="margin20"></div>
							    <div>
							        <table class="tableCss" cellpadding="0" cellspacing="0">
							            <tr class="titleTr">
							                <th width="230px">产品</th>
							                <th width="110px">数量</th>
							                <th width="150px">价格</th>
							                <th width="140px">金额</th>
							            </tr>
							            <c:if test="${ctForm!=null}">
									        <c:if test="${ctForm.ctItemForms!=null}">
												<c:forEach items="${ctForm.ctItemForms}" var="ctItemForm" varStatus="index">
													<c:if test="${ctItemForm.index % 2==1}">
														<tr align="left" class="contTr-old"  >
													</c:if>
													<c:if test="${ctItemForm.index % 2==0}">
														<tr align="left" class="contTr-even">
													</c:if>
														<td class="td1">
															<span class="prodName">${ctItemForm.prodName}</span><br/>
															<c:if test="${ctItemForm.invcode!=null && ''!=ctItemForm.invcode}">编码：${ctItemForm.invcode}<br/></c:if>
															<c:if test="${ctItemForm.module!=null && ''!=ctItemForm.module}">规格：${ctItemForm.module}<br/></c:if>
															<c:if test="${ctItemForm.type!=null && ''!=ctItemForm.type}">型号：${ctItemForm.type}<br/></c:if>
															<c:if test="${ctItemForm.batchNo!=null && ''!=ctItemForm.batchNo}">批次号：${ctItemForm.batchNo}<br/></c:if>
															<c:if test="${ctItemForm.def18!=null  && ''!=ctItemForm.def18}">主机号：${ctItemForm.def18}<br/></c:if>
															<c:if test="${ctItemForm.graphid!=null  && ''!=ctItemForm.graphid}">图号：${ctItemForm.graphid}<br/></c:if>
															<c:if test="${ctItemForm.def20!=null  && ''!=ctItemForm.def20}">技术要求：${ctItemForm.def20}<br/></c:if>
															<c:if test="${ctItemForm.xuqiugongsi!=null  && ''!=ctItemForm.xuqiugongsi}">需求公司：${ctItemForm.xuqiugongsi}<br/></c:if>
															<c:if test="${ctItemForm.transferName!=null && ''!=ctItemForm.transferName}">合同号：${ctItemForm.contractNo}<br/></c:if>
															<c:if test="${ctItemForm.produceFactory!=null && ''!=ctItemForm.produceFactory}">生产厂商：${ctItemForm.produceFactory}<br/></c:if>
															<c:if test="${ctItemForm.qualityLevel!=null && ''!=ctItemForm.qualityLevel}">质量等级：${ctItemForm.qulityLevel}<br/></c:if>
															<c:if test="${ctItemForm.transferName!=null && ''!=ctItemForm.transferName}">运输方式：${ctItemForm.transferName}<br/></c:if>
															<c:if test="${ctItemForm.desc!=null && ''!=ctItemForm.desc}">描述：${ctItemForm.desc}</c:if>&nbsp;
														</td>
														<td class="td1">${ctItemForm.number}${ctItemForm.measureName} &nbsp;</td>
														<td class="td1">
															含税单价：${ctItemForm.taxPrice}<br/>
															折扣率：${ctItemForm.discount}%<br/>
															净含税单价：${ctItemForm.netTaxPrice}&nbsp; 
														</td>
														<td class="td1">
															税率：<c:if test="${ctItemForm.rate!=null && ''!=ctItemForm.rate}" >${ctItemForm.rate}%</c:if><br/>
															价税合计：${ctItemForm.priceTaxTotal}&nbsp; 
														</td>
													</tr>
												</c:forEach>
											</c:if>
										</c:if>
							            <tr class="titleTr">
							                <td width="230px">合计</td>
							                <td width="110px"></td>
							                <td width="150px"></td>
							                <td width="140px">${ctForm.totalTaxPrice}</td>
							            </tr>
									</table>
							    </div>
							    <div class="margin20"></div>
							    <div>
							        <table class="tableCss" cellpadding="0" cellspacing="0">
							            <tr class="titleTr">
							                <th width="100px">条款名称</th>
							                <th width="700px" class="th1">条款内容</th>
							            </tr>
							            <c:if test="${ctForm!=null}">
									        <c:if test="${ctForm.ctTerms!=null}">
												<c:forEach items="${ctForm.ctTerms}" var="ctTerm" varStatus="index">
													<c:if test="${ctTerm.index % 2==1}">
														<tr align="left" class="contTr-old"  >
													</c:if>
													<c:if test="${ctTerm.index % 2==0}">
														<tr align="left" class="contTr-even">
													</c:if>
														<td class="td3">${ctTerm.termName}&nbsp;</td>
														<td class="td3">${ctTerm.termContent}&nbsp;</td>
													</tr>
													
													<c:if test="${ctTerm.index % 2==1}">
														<tr align="left" class="contTr-old"  >
													</c:if>
													<c:if test="${ctTerm.index % 2==0}">
														<tr align="left" class="contTr-even">
													</c:if>
														<td class="td4" colspan="2" >
															其他信息：<c:if test="${ctTerm.otherInfo !=null && ''!=ctTerm.otherInfo}"> ${ctTerm.otherInfo}&nbsp;</c:if>
															<c:if test="${ctTerm.otherInfo ==null && ''==ctTerm.otherInfo}"> 暂无&nbsp;</c:if>
														</td>
													</tr>
													<c:if test="${ctTerm.index % 2==1}">
														<tr align="left" class="contTr-old"  >
													</c:if>
													<c:if test="${ctTerm.index % 2==0}">
														<tr align="left" class="contTr-even">
													</c:if>
														<td class="td2" colspan="2">
															备注：<c:if test="${ctTerm.memo !=null && ''!=ctTerm.memo}"> ${ctTerm.memo}&nbsp;</c:if>
															<c:if test="${ctTerm.memo ==null && ''==ctTerm.memo}"> 暂无&nbsp;</c:if>
														</td>
													</tr>
												</c:forEach>
											</c:if>
										</c:if>
									</table>
							    </div>
								<div class="margin20"></div>
								    <div>
								        <table class="tableCss" cellpadding="0" cellspacing="0">
								            <tr class="titleTr">
								                <th widht="88px">费用名称</th>
								                <th widht="712px" class="th1">费用金额 </th>
								            </tr>
								            <c:if test="${ctForm!=null}">
										        <c:if test="${ctForm.ctFees!=null}">
													<c:forEach items="${ctForm.ctFees}" var="ctFee" varStatus="index">
														<c:if test="${ctFee.index % 2==1}">
															<tr align="left" class="contTr-old"  >
														</c:if>
														<c:if test="${ctFee.index % 2==0}">
															<tr align="left" class="contTr-even">
														</c:if>
															<td class="td3">${ctFee.feeName}&nbsp;</td>
															<td class="td3">${ctFee.feeAmount}&nbsp;</td>
														</tr>
														<c:if test="${ctFee.index % 2==1}">
															<tr align="left" class="contTr-old"  >
														</c:if>
														<c:if test="${ctFee.index % 2==0}">
															<tr align="left" class="contTr-even">
														</c:if>
															<td class="td2" colspan="2">
																备注：${ctFee.memo} &nbsp;
															</td>
														</tr>
													</c:forEach>
												</c:if>
											</c:if>
										</table>
								    </div>
							    <div class="margin20"></div>
							    <div>
							    	<form name="form1" method="post">
								        <table width="600" align="center" border="0" cellspacing="0" cellpadding="0">
								            <tr id="contract_confirm" align="center">
								                <td>
								                	 <c:if test="${ctForm.confirmStatus==1}">
								                	 	  <input type="button" class="btnscs" value="接受" onclick="acceptContract()" />&nbsp;&nbsp;
								                	 	  <input type="button" class="btnscs" value="拒绝" onclick="rejectContract()" />&nbsp;&nbsp;
								                	 </c:if>
								                    <input type="button" class="btnscs" value="返回" onclick="goback()" />&nbsp;&nbsp;
								                </td>
								            </tr>
								        </table>
							        </form>
							    </div>
							</div>
			                <div class="margin20"></div>
							<div id="message" class="mycolor">
								<c:out value="${ERROR_MESSAGE}"></c:out>
							</div>
						</div>
                    </div>
                    <div class="margin8"></div>
                    <div class="margin8">
                    	<table align="left">
							<tr class="title">
								<td>
									<div id="message" class="msgcolor">${system_err_msg}</div>
								</td>
							</tr>
						</table>
					</div> 
                </div>
            </div>
        <div class="margin20"></div>
</body>
</html>
